﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;

public partial class admin_delCourse : System.Web.UI.Page
{
    db_course course = new db_course();
    protected void Page_Load(object sender, EventArgs e)
    {
        Server.Execute("checkTeach.aspx");  // 此处用户权限验证

        string courseId = Request.QueryString["id"];
        //通过验证控件的验证
        if (courseId != null)
        {
            if (course.delCourse(courseId))
            {
                Response.Write("<script language=javascript>alert('删除成功！');location.href='courseInfo.aspx';</script>");
            }
            else
            {
                Response.Write("<script language=javascript>alert('删除失败！');location.href='courseInfo.aspx';</script>");
            }

        }
        else
        {
            Response.Redirect("courseInfo.aspx");
        }

    }
}